package com.atguigu.gulimall.cart.service;

import com.atguigu.gulimall.cart.vo.Cart;
import com.atguigu.gulimall.cart.vo.CartItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @Classname CartService
 * @Description TODO
 * @Date 2021/9/24 11:30
 * @Author Anonymous
 */
@SuppressWarnings("all")
public interface CartService {
    /**
     * 将商品添加到购物车
     */
    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    /**
     * 获取购物项
     */
    CartItem getCartItem(Long skuId);

    /**
     * 获取购物车
     */
    Cart getCart() throws ExecutionException, InterruptedException;

    /** 清楚临时购物车中的数据 */
    void clearCartInfo(String key);

    void checkItem(Long skuId, Integer checked);

    void changeItemCount(Long skuId, Integer num);

    void deleteIdCartInfo(Integer skuId);

    List<CartItem> getUserCartItems();
}
